import Vue from 'vue'
import Vuex from 'vuex'

import {
  eduSignInPersonQuery,
  eduSignInPersonDelete,
  eduSignInPersonAdd,
  eduSignInPersonUpdate,
} from '@/api/admin/courseLibrary/eduSignInPerson.js'

Vue.use(Vuex)

const state = {}

const getters = {}

const actions = {
  async queryeduSignInPerson({ commit }, listQuery) {
    let res = await eduSignInPersonQuery({ ...listQuery })
    return res.data.code == 0 ? res.data : Promise.reject(new Error('faile'))
  },
  async deleteeduSignInPerson({ commit }, row) {
    let res = await eduSignInPersonDelete(row.id)
    return res.data.code == 0 ? res.data : Promise.reject(new Error('faile'))
  },
  async addeduSignInPerson({ commit }, data) {
    let res = await eduSignInPersonAdd(data)
    return res.data.code == 0 ? res.data : Promise.reject(new Error('faile'))
  },
  async updateeduSignInPerson({ commit }, data) {
    let res = await eduSignInPersonUpdate(data)
    return res.data.code == 0 ? res.data : Promise.reject(new Error('faile'))
  },
}

const mutations = {}

export default {
  state,
  getters,
  actions,
  mutations,
}
